Skip to content

Remove additional elements from the active formatting elements list#58508

Merged
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-7535115
Mar 15, 2026
Merged

Remove additional elements from the active formatting elements list#58508
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-7535115

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 15, 2026

Our current implementation of the adoption algorithm [1] misses one of
the step defined in the specification:

13.4- If innerLoopCounter is greater than 3 and node is in the list of active formatting elements, then remove node from the list of active formatting elements.

This causes that some extra reconstruction is done, causing different
DOM trees than the ones Firefox and Safari builds in some malformed HTML
content.

Some of the failures in the removed from the expected.txt files are
examples of these interop issues in the DOM reconstruction provided by
the adoption algorithm. I have defined an unit tests with one of these
examples, because I think it's easier to understand and debug these
cases.

[1]
html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm

Bug: 4077595
Change-Id: I92a79e68c21f85a52822a57deccbb48ae21afc52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7535115
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1599642}

Our current implementation of the adoption algorithm [1] misses one of
the step defined in the specification:

> 13.4- If innerLoopCounter is greater than 3 and node is in the list of active formatting elements, then remove node from the list of active formatting elements.

This causes that some extra reconstruction is done, causing different
DOM trees than the ones Firefox and Safari builds in some malformed HTML
content.

Some of the failures in the removed from the expected.txt files are
examples of these interop issues in the DOM reconstruction provided by
the adoption algorithm. I have defined an unit tests with one of these
examples, because I think it's easier to understand and debug these
cases.

[1]
html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm

Bug: 4077595
Change-Id: I92a79e68c21f85a52822a57deccbb48ae21afc52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7535115
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1599642}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 192f133 into master Mar 15, 2026
27 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7535115 branch March 15, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants